<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018\9\28 0028
 * Time: 16:59
 */

namespace app\index\interfaceIn;


use app\Lib\Exception\BlException;
use app\Lib\InterfaceIn\Api\Api;
use app\Lib\Ioc\Role\RoleManage;

class getRoleInfo extends Common implements Api
{
    /**
     * 执行代码
     * @return mixed
     * @throws BlException
     */
    public function handle()
    {
        $this->check();
        $data   = $this->param->postData;
        $result = (new RoleManage())->getInfo($data);
        return $this->returnCreate($result);
    }

    /**
     * 参数验证
     * @return bool
     * @throws BlException
     */
    public function check()
    {
        $data = $this->param->postData;
        if(empty($data['roleId'])){
            throw new BlException('未获取到修改数据');
        }
        return true;
    }

}